﻿@model Stardust.Models.ProductoxProveedorBean

@{
    ViewBag.Title = "Asignar Productos";
}

<h2>Asignar Productos</h2>
<p></p><p></p><p></p>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validationEngine-en.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validationEngine.js")" type="text/javascript"></script>

    
  @using (Html.BeginForm("guardarproductosxProveedor", "Proveedor", FormMethod.Post, new { @class = "form", id = "validate" }))
  {
    @Html.HiddenFor(model => model.idproveedor)
    <fieldset>
        <div class="widget">
            <div class="title">
                <h6>Proveedor</h6>
            </div>
            <div class="formRow"> @Html.LabelFor(model => model.Proveedor)
                <div class=" formRight"> @Html.TextBoxFor(model => model.Proveedor, new { @readonly = "readonly" })  </div>
                <div class="clear"></div>
            </div>
            
            
        </div>
    </fieldset>
    
    <p></p><p></p><p></p><p></p>

        <table cellpadding = "0" cellspacing = "0" width = "100%" class = "sTable" >

    <thead>
        <tr>
           
           <td>Producto</td>
           <td>Precio</td>
        
        </tr>
    </thead>

    <tbody>
    @for (int i = 0; i < Model.listProdProv.Count; i++)
    {

        if (!Model.listProdProv[i].estado2)
        {
         @Html.HiddenFor(model => model.listProdProv[i].ID, new { @readonly = "readonly" }) 
     <tr>       
                
                <td> @Html.TextBoxFor(model => model.listProdProv[i].nombre, new { @readonly = "readonly" }) </td>
                <td> @Html.TextBoxFor(model => model.listProdProv[i].precio, new { @class = "validate[custom[onlyNumberSp]]", name = "numsValid", placeholder = "0.00" })         </td>
                   
     </tr>
        }
        else
        {
            @Html.HiddenFor(model => model.listProdProv[i].nombre) 
            @Html.HiddenFor(model => model.listProdProv[i].precio)         
            @Html.HiddenFor(model => model.listProdProv[i].cantMaxima)  
        }
    }

    
    </tbody>

    </table>

    <p>

            <input type="submit" value="Aceptar" class = "redB" />

      </p>    
        
       @Html.ActionLink("Regresar", "ListarProductos/" + Model.idproveedor, "Proveedor");
  }

    

              
  